<template>
    <p>这是一个子组件</p>
    <p>父组件传下来的值---{{ parentMsg }}</p>
    <button @click="changeParentMsg">将子组件的信息传给父组件</button>
</template>


<script>
export default {
    name: "ChildCom",
    emits:['test'],
    props: {
        parentMsg:''
    },
    methods:{
        changeParentMsg(){
            this.$emit("test",456)
        }
    }
}
</script>